<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- ArcGIS API for JavaScript本地部署地址 -->
    <!-- <link rel="stylesheet" hrel="http://localhost/arcgis_js_v416_sdk/arcgis_js_api/library/4.16/esri/css/main.css" />
    <script src="http://localhost/arcgis_js_v416_sdk/arcgis_js_api/library/4.16/dojo/dojo.js"></script> -->

    <!-- jquery-2.0.3.min.js是jquery-2.0.3.js的编译版本 -->
    <!-- jQuery 库是一个 JavaScript 文件,下面在线引用它。 -->
    <!-- <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script> -->

    <link rel="stylesheet" hrel="http://localhost/4.17/esri/css/main.css" />
    <script src="http://localhost/4.17/dojo/dojo.js"></script>
    <style>
        html,
        body,
        #viewDiv {
            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;
        }
    </style>

    <script>
        require([
            "esri/Map",
            "esri/Basemap",
            "esri/views/MapView",
            "esri/views/SceneView",
            "esri/geometry/Extent",
            "esri/geometry/SpatialReference",
            //几何
            "esri/geometry/Point",
            "esri/geometry/Polyline",
            "esri/geometry/Polygon",
            "esri/geometry/Circle",
            "esri/Graphic",
            "esri/widgets/Sketch",
            "esri/Color",
            //切片地图信息
            "esri/layers/support/TileInfo",
            //图层
            "esri/layers/WebTileLayer",
            "esri/views/layers/LayerView",
            "esri/layers/TileLayer",
            "esri/layers/MapImageLayer",
            "esri/layers/FeatureLayer",
            "esri/layers/GraphicsLayer",
            //符号化
            "esri/symbols/SimpleMarkerSymbol",
            "esri/symbols/SimpleFillSymbol",
            "esri/symbols/SimpleLineSymbol",
            //缓冲参数，用于GeometryService
            "esri/tasks/support/BufferParameters",
            //几何处理，投影、简化、缓冲区
            "esri/tasks/GeometryService",
            //几何引擎，用于测试、测量和分析两个或多个二维几何图形之间的空间关系,缓冲、修剪、距离、相交、联合、面积距离计算等。
            "esri/geometry/geometryEngine",
            //代理
            "esri/core/urlUtils",
            //查询
            "esri/tasks/FindTask",
            "esri/tasks/support/FindParameters",
            "esri/tasks/QueryTask",
            "esri/tasks/support/Query",
            "esri/tasks/IdentifyTask",
            "esri/tasks/support/IdentifyParameters",
            //打印地图
            "esri/tasks/PrintTask",
            "esri/tasks/support/PrintTemplate",
            "esri/tasks/support/PrintParameters",
            "dojo/dom",
            "dojo/on",
            "dojo/domReady!"
        ], function(
            Map,
            Basemap,
            MapView,
            SceneView,
            Extent,
            SpatialReference,
            Point,
            Polyline,
            Polygon,
            Circle,
            Graphic,
            Sketch,
            Color,
            TileInfo,
            WebTileLayer,
            LayerView,
            TileLayer,
            MapImageLayer,
            FeatureLayer,
            GraphicsLayer,
            SimpleMarkerSymbol,
            SimpleFillSymbol,
            SimpleLineSymbol,
            BufferParameters,
            GeometryService,
            geometryEngine,
            urlUtils,
            FindTask,
            FindParameters,
            QueryTask,
            Query,
            IdentifyTask,
            IdentifyParameters,
            PrintTask,
            PrintTemplate,
            PrintParameters,
            dom,
            on) {
            var layer = new MapImageLayer({
                url: "http://localhost:6080/arcgis/rest/services/Qingdao/MapServer"
            });
            var map = new Map({ //属性：allLayers、ground、layers
                basemap: "topo",
                layers: [layer]
            });
            var view = new MapView({
                container: "viewDiv",
                map: map,
                zoom: 11,
                SpatialReference: {
                    wkid: 102100,
                },
                center: [120.389583, 36.085579] // longitude, latitude
            });
            var graphicLayer = new GraphicsLayer();
            map.add(graphicLayer);
            view.on("click", function(eve) {
                var len = 10;
                var rads = 10000;
                var rad = rads / len;
                for (var i = 0; i < len; i++) {
                    var circle = new Circle({
                        type: "circle",
                        center: [eve.mapPoint.longitude, eve.mapPoint.latitude],
                        radius: i * rad,
                        geodesic: true,
                        radiusUnit: "meters",
                        spatialReference: {
                            wkid: 102100
                        }
                    });
                    var SimpleLineSymbol = {
                        type: "simple-line",
                        color: [255, 0, 0],
                        style: "solid",
                        width: 2
                    };
                    var graphic = new Graphic({
                        geometry: circle,
                        symbol: SimpleLineSymbol
                    });
                    graphicLayer.add(graphic);
                }

            });
        });
    </script>
</head>

<body>
    <div id="viewDiv"></div>
</body>

</html>